package com.hdax.dm.controller;

import com.hdax.dm.dto.DescItemDto;
import com.hdax.dm.dto.ItemCinemaDto;
import com.hdax.dm.service.DescService;
import com.hdax.dm.utils.response.CommonResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/item/desc")
public class DescController {

    @Autowired
    private DescService descService;


    //  获取详情数据信息， 主要是项目功能信息。
    @PostMapping("getItems")
    public CommonResponse<DescItemDto> getItems(@RequestBody Map<String,Integer> map){
        return descService.getItems(map.get("id"));
    }

    //  获取推荐信息
    @PostMapping("getRecommend")
    public CommonResponse<List<ItemCinemaDto>> getRecommend(@RequestBody Map<String,Integer> map){
        return descService.getRecommend(map.get("itemTypeId"));
    }
}

